


const header = new Vue({
    el:"#header",
    data(){
        return{
            titleName:"某一个项目",
            modelType:"",
        }
    },
    methods:{
        /**
         * 插入到头部的数据
         * @param {} titleName 
         */
        data_setTitleName:function(titleName)
        {
            this.titleName = titleName;
        },
        data_getTimeName:function()
        {
            return this.titleName;
        },
        /**
         * 插入到模式按钮的数据
         */
        data_setModelType(modelType)
        {
            this.modelType = modelType;
        },
        data_getModelType()
        {
            return modelType;
        },

        //点击文件事件
        on_fileClick:function()
        {
            components.data_set_component_manage_isShow(!components.data_get_component_manage_isShow());
            console.log("file",components.data_get_component_manage_isShow());
        },
        //保存名称事件
        on_saveName:function()
        {
            // console.log("name",this.data_getTimeName());
            main.requestData.projectName = this.data_getTimeName();
        },
        //保存项目按钮事件
        on_saveClick:function()
        {
            console.log("save");
            main.fun_data_saveData();
        },
        //模型事件切换
        on_moudelType:function(data)
        {
            console.log("model",data);
            //切换后模式刷新下链接线清空并创建   判断该不该清空线条
            if(main.requestData.modelType != data)
            {
                main.stringList = [];
            }
            main.requestData.modelType = data;
            this.modelType = main.requestData.modelType;

            main.fun_component_updateLink(()=>{
                
               
            });


        }
    },
    created:function()
    {

    }
})











var headerDom = document.getElementById("header");
var headerMdelShiftDom = document.getElementById("header-modelShift");


//动画初始化
function header_init(){
    //执行动画内容
    headerDom.style.transform = "translateY(-100px)";
    headerMdelShiftDom.style.transform = "translateY(-20px)";
    headerMdelShiftDom.style.opacity = "0";

}
header_init();




//动画执行
function header_exit(){

    setTimeout(()=>{
        //执行动画内容
        anime({
            targets:headerDom,
            duration:900,
            // delay:1000,
            translateY: 0,
            update:function(){
            }
        });
        setTimeout(headerMdelShift_exit,600);
    },Math.round(Math.random()*600));


}
function headerMdelShift_exit(){
    //执行动画内容
    anime({
        targets:headerMdelShiftDom,
        duration:700,
        // delay:1000,
        translateY: 0,
        opacity:1,
        update:function(){
        }
    });
}

setTimeout(header_exit,000);
